﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Zatify.WebUI.Models;
using Zatify.Domain.Abstract;
using System.Configuration;

namespace Zatify.WebUI.Controllers
{
    //[Authorize]
    public class HomeController : Controller
    {
        private IZatifyEmailSender emailSender;

        public HomeController(IZatifyEmailSender emailSender)
        {
            this.emailSender = emailSender;
        }

        public ActionResult Index()
        {
            return View();
        }

        //public ActionResult AboutUs()
        //{
        //    return View();
        //}

        public ActionResult MoreInfo()
        {
            return View();
        }

        public ActionResult MissionStatement()
        {
            return View();
        }

        public ActionResult SessionExpired()
        {
            return View();
        }

        [HttpGet]
        public ViewResult FAQ()
        {
            return View(new FAQSupportViewModel());
        }

        [HttpPost]
        public ViewResult FAQ(FAQSupportViewModel model)
        {
            if (ModelState.IsValid)
            {
                emailSender.SendPasswordRecoveryToEmail(model.Name, model.Email, model.CompanyName, model.PhoneNo, model.Subject, model.Message);
                
                ModelState.Remove("Message");
                model.Message = "";
            }

            return View();
        }

        public ActionResult CustomerSupport()
        {
            return View();
        }

        public ActionResult PrivacyPolicy()
        {
            return View();
        }

        public ActionResult TermsOfUse()
        {
            return View();
        }

        public ActionResult UserInfo()
        {
            ViewBag.RegularUserMediaFileKey = ConfigurationManager.AppSettings["RegularUserMediaFileKey"];

            return View();
        }

        public ActionResult ConsumerTutorial()
        {
            ViewBag.RegularUserMediaFileKey = ConfigurationManager.AppSettings["RegularUserMediaFileKey"];

            return View();
        }

        public ActionResult BusinessOwners()
        {
            ViewBag.BusinessUserMediaFileKey = ConfigurationManager.AppSettings["BusinessUserMediaFileKey"];

            return View();
        }

        public ActionResult BusinessTutorial()
        {
            ViewBag.BusinessUserMediaFileKey = ConfigurationManager.AppSettings["BusinessUserMediaFileKey"];

            return View();
        }

        public ActionResult Advertising()
        {
            return View();
        }

        public ActionResult AdTutorial()
        {
            return View();
        }

        public ActionResult AppInfo()
        {
            return View();
        }

        [HttpGet]
        public ViewResult PushTest()
        {
            return View(new PushTestModel());
        }

        [HttpPost]
        public ViewResult PushTest(PushTestModel model)
        {
            if (ModelState.IsValid)
            {
                Utils.SendNotification(model.DeviceToken, model.Message, model.AlertMode);
            }

            return View(model);
        }
    }
}
